<%@page contentType="text/html" pageEncoding="UTF-8"%>

<%@taglib prefix="html" uri="http://struts.apache.org/tags-html"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="logic" uri="http://struts.apache.org/tags-logic"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>

	
<script type="text/javascript">
    function printdiv(idDiv) {
        var w = 800;
        var h = 600;
        var l = (window.screen.availWidth - w) / 2;
        var t = (window.screen.availHeight - h) / 2;

        var sOption = "toolbar=no,location=no,directories=no,menubar=no,scrollbars=yes,width=" + w + ",height=" + h + ",left=" + l + ",top=" + t;
        // Get the HTML content of the div
        var sDivText = window.document.getElementById(idDiv).innerHTML;
        // Open a new window
        var objWindow = window.open("", "Print", sOption);
        // Write the div element to the window
        objWindow.document.write(sDivText);
        objWindow.document.close();
        // Print the window            
        objWindow.print();
        // Close the window
        objWindow.close();
    } 
</script>
	<link href="style.css" rel="stylesheet" type="text/css" >
	
	<body class="body" >
	
	<div id="divID">	
		<html:form action="/ticketList" method="POST"  >
			<table border='1' class="ticket">
				<tr>
					<td colspan="2" align="center">
						${id_ticket}
					</td>
					
				</tr>

				<tr>
					<td colspan="2">
						<bean:message key="label.ticket"/>
				    </td>
				</tr>
				<tr>
					<td>    
				        <bean:message key="label.name_order"/>
					</td>
					<td>
						<b>${name_order}</b>
					</td>
				</tr>
				<tr>
					<td>    
				        <bean:message key="label.cityFrom"/> - 
				        <bean:message key="label.cityTo"/>
					</td>
					<td> 
						<b>${cityFrom} - ${cityTo}</b> 
					</td>
				</tr>
				
				<tr>
					<td>    
				        <bean:message key="label.your_train"/>
					</td>
					<td> 
						<b>${your_train}</b> 
					</td>
				</tr>
				<tr>
					<td align="right" colspan="2">
						<html:button property="print" onclick="printdiv('divID')"><bean:message key="button.print"/> </html:button>			
					</td>
				</tr>
			</table>
				<html:submit property="back"><bean:message key="button.back"/></html:submit>
				
			</html:form>
		</div>
	</body>
		
	

